home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / doc / dme.doc < prev    next >
Text File  |  1994-02-13  |  34KB  |  870 lines

  1.  
  2. dme/dme                             dme/dme
  3.  
  4. DME.DOC         DME version 1.45         Matthew Dillon
  5.                July 1991
  6.  
  7. DME, (C)Copyright 1987-90, Matthew Dillon.  All Rights Reserved.
  8. This software may be distributed for non-profit only.  This software is
  9. FREEWARE, not shareware.
  10.  
  11.     Matthew Dillon
  12.     891 Regal Rd
  13.     Berkeley, Ca. 94708
  14.     USA
  15.  
  16.  
  17.     Source is avalable:
  18.  
  19.     (1) By regular mail (send a disk)
  20.     (2) By Electronic mail:
  21.         INTERNET:    uunet.uu.net!overload!dillon        OR
  22.             dillon@overload.Berkeley.CA.US
  23.  
  24.     Donations welcome but not solicited (I ain't a starving artist).
  25.  
  26.     icon by Bryce Nesbitt
  27.  
  28.     text markers and the text-block stack by Kevin Seghetti (some of the new
  29.     commands for 1.30).
  30.  
  31.     AREXX interface (Bill Hawes' ARexx REXX language interpreter) ported
  32.     by Kim DeVaughn
  33.  
  34.     1.42 additions by Markys Wenzel
  35.  
  36. ---------------------------------------------------------------------------
  37.  
  38. 0   Installation
  39. I   Overview
  40. II  Keymapping        key and mouse mapping
  41. III Command Sequences    DME commands
  42. IV  File Particulars    notes on loading and saving files,
  43. V   Workbench Support
  44. VI  Revision Summary    revision numbering, changes made, etc...
  45. VII Compiling        compiling instructions
  46.  
  47.                     0
  48.                    INSTALLATION
  49.  
  50. The NULL: device must be mounted to be able to use the EXECUTE command.
  51. This is so EXECUTE works even if the console window goes away.    Otherwise,
  52. simply put DME in an accessable location (usually C:).  Put the dme.icon
  53. file in the same directory as DME if you want to access the application
  54. from the workbench (dme.icon is not needed if accessed from a CLI or shell).
  55.  
  56. People appear to have problems using the EXECUTE command when DME is run
  57. from the workbench.  I have no solution yet.
  58.  
  59. CONFIGURATION of default window placement, pen selection, and most editor
  60. modes (insert/overwrite, margin, etc...) is accomplished by bringing up
  61. DME, setting it up how you like, then selecting the SAVECONFIG menu
  62. option (saves to s:dme.config).
  63.  
  64.  
  65.                     I
  66.                  OVERVIEW
  67.  
  68. See REVISIONS section for revisions.  DME is an editor designed mainly for
  69. programmers.  Although it is not a word processor, it does include many
  70. word processing features such as Word-Wrap and automatic paragraph
  71. formatting.  Here is a quick 'features' list:
  72.  
  73.     -control language based on a rich command set accessed manually
  74.      or via arbitrary mapping of keys.  (Every key may be mapped to 128
  75.      different things via qualifier and mouse keys)
  76.  
  77.     -General variables, reference macros as variables, ENV: enviroment
  78.      variables (1.30C and beyond).
  79.  
  80.     -fast visual response (it scrolls quickly)... even faster when
  81.      BlitzFonts or similar text speedup utilities are installed.
  82.  
  83.     -title-line statistics showing your current position in the file,
  84.      file name, whether the file has been modified or not, etc...
  85.  
  86.     -Multiple Windows, ability to iconify windows
  87.  
  88.     -Word Wrap and automatic paragraph formatting.
  89.  
  90.     -ability to map any KEY or MOUSE BUTTON combination.
  91.  
  92. DME has been designed to allow easy expansion, and I intend to make many
  93. future improvments.  It has not been designed for user friendliness, but is
  94. straight forward if you read this document [care]fully.
  95.  
  96. AS OF 1.40 and until further notice DME no longer takes command line
  97. arguments other than file arguments, or workbench based window arguments.
  98. DME used to take arguments to specify window dimensions.  Use the saveconfig
  99. command to setup default window parameters.
  100.  
  101. The 1.40-41 Version is an experimental intermediate version, documentation may
  102. not be up to date.
  103.  
  104. Normally, DME will automatically SOURCE two script files, S:.EDRC, and the
  105. .EDRC in your current directory. These files do not have to exist.  These
  106. script files usually contain mappings and do things (for example, turn on
  107. savetabs).
  108.  
  109.  
  110.                     II
  111.                  KEYMAPPING
  112.  
  113. MOUSE BUTTONS:
  114.  
  115.     The mouse buttons and combinations thereof may now be mapped.  The
  116.     default mappings for the mouse buttons are as follows:
  117.  
  118.     Left-button:    Move cursor to current mouse position
  119.     Right-button:   Iconify window
  120.     Left-button held down while moving mouse tracks the cursor
  121.  
  122.     The iconification features:
  123.     -Remembers original window size and placement
  124.     -Remembers placement of iconified window when you re-iconify later.
  125.  
  126.     Currently, you will crash the machine if you run out of memory and DME
  127.     is unable to open the icon window or original window, so be careful.
  128.  
  129.     see below for mapping the mouse buttons and mouse movement.
  130.  
  131.  
  132. KEYBOARD:
  133.  
  134. The rest of the Functional interface for DME is based on key/mouse/menu
  135. mappings and a rich command set.  Unlike other text editors, any
  136. non-qualifier key in DME may be defined to have any meaning whatsoever.  It
  137. just so happens that the default keymappings assign such things as the
  138. (return) key to the RETURN function, the (up) key to the UP function,
  139. etc...    Keys are named by their keycap labels with the following
  140. exceptions:
  141.  
  142.     the name for Back-Space is    BS
  143.     the name for numeric keypad keys are prepended with an NK, except for
  144.     the Enter key which is named 'ENTER'.
  145.     The four cursor control keys are labeled UP, DOWN, LEFT, and RIGHT
  146.     The three mouse buttons are labeled RMB, MMB, and LMB.
  147.  
  148. NOTES:
  149.        You must type commands in lower-case, except for text, which can be
  150.        either lower or upper case, and for upper-case alpha keys when
  151.        specifying keymaps (i.e.  A and s-a are the same key).  The
  152.        exception is the AMIGA qualifier key, which uses 'A' instead of
  153.        'a'(Alt).
  154.  
  155.        Each key may be qualified with any combination of CTRL, ALT, SHIFT,
  156.        AMIGA, or any of the MOUSE buttons.  With 6 qualifiers (7 if your
  157.        mouse has a middle button), you can assign up to 64 (128) different
  158.        maps to each physical key on the keyboard.
  159.  
  160.        The CAPS-LOCK, when lit, is equivalent to SHIFT only for Alpha keys.
  161.  
  162.        The AMIGA-ALT (aA) combination isn't very usable since Intuition
  163.        uses the sequence to duplicate a Mouse SELECT.  Other AMIGA
  164.        sequences are used by intuition for mouse movement and other things.
  165.        Some other qualifier combinations may not be usable due to other
  166.        special sequences.
  167.  
  168.        Some keys must be mapped by their lower-case keycap.  That is, to
  169.        map the '>' key (USA keyboard), you specify shift dot (s-.)
  170.  
  171.  
  172.     ***EXAMPLES:***
  173.  
  174.     tab tab
  175.     a-a ALT a
  176.     A-a AMIGA a
  177.     sA-a    SHIFT AMIGA a
  178.     s-tab    SHIFT tab
  179.     c-tab    CTRL tab
  180.     ac-?    ALT-CTRL ?
  181.     s-f5    SHIFT F5
  182.     nk0 Numeric Keypad 0
  183.     cs-nk0    CTRL SHIFT Numeric Keypad 0
  184.     L-lmb    Left Mouse button pressed
  185.     L-mmove    Mouse moved while left mouse button held down
  186.     LR-lmb    left mouse button hit while right mouse button held down
  187.     s-.     shift . ('>' for USA keyboards)
  188.  
  189.     ***************
  190.  
  191. MAPPING MOUSE BUTTONS
  192.  
  193.     Mouse buttons serve both as QUALIFIERS and as KEYS.  Thus, you can map
  194.     both normal keystrokes which require a mouse button to be held down:
  195.  
  196.     map L-a ((left button and an a))
  197.  
  198.     as well as the mouse keys themselves:
  199.  
  200.     map L-lmb   ((left mouse key))
  201.  
  202.     note that you had to specify the left mouse button down qualifier L as
  203.     well as the left mouse button LMB.
  204.  
  205.     If you map the left mouse button, and also map a sequence such as left
  206.     mouse button + a:
  207.  
  208.     map L-lmb   tomouse
  209.     map L-a     ((hello))
  210.  
  211.     Note that the first mapping will always get executed even if you
  212.     intended L-a (that is, BOTH mappings would get executed).  In order
  213.     to avoid confusion you might want to UNMAP the system default mapping
  214.     for the right mouse button (mapped to ICONIFY) if you wish to apply
  215.     combinations to the right mouse button.
  216.  
  217.     MOUSE MOVEMENT is mapped with one or more mouse qualifiers (L, R, M),
  218.     plus 'MMOVE' for the key.  That is:
  219.  
  220.     map LR-mmove ((moving the mouse with both buttons held down))
  221.  
  222.     Or how bout capping the characters under the mouse while moving the
  223.     mouse?
  224.  
  225.     map LR-mmove (tomouse if cl (tlate -32))
  226.  
  227.  
  228.  
  229. DEFAULT KEYMAPPINGS:
  230.  
  231.     All Printable Ascii keys mapped to their ascii equivalent. BS, DEL, UP,
  232.     DOWN, LEFT, RIGHT, TAB, S-TAB, and ENTER are mapped properly.  These are
  233.     the default system keymappings.
  234.  
  235.  
  236.     map (a-c)       (bcopy)
  237.     map (a-d)       (bdelete)
  238.     map (a-down)    (scrolldown)
  239.     map (a-l)       (while cu (tlate +32 right))
  240.     map (a-m)       (bmove)
  241.     map (a-r)       (nextr)
  242.     map (a-s)       (bsource)
  243.     map (a-u)       (while cl (tlate -32 right))
  244.     map (a-up)      (scrollup)
  245.     map (bs)        (bs)
  246.     map (c-/)       (escimm (find ))
  247.     map (c-])       (ref)
  248.     map (c-[)       (ctags)
  249.     map (c-1)       (goto block)
  250.     map (c-b)       (block)
  251.     map (c-c)       ()
  252.     map (c-del)     (remeol)
  253.     map (c-down)    (pagedown)
  254.     map (c-esc)     (recall)
  255.     map (c-f)       (reformat)
  256.     map (c-g)       (escimm (goto ))
  257.     map (c-i)       (insertmode on)
  258.     map (c-j)       (join)
  259.     map (c-l)       (wleft)
  260.     map (c-n)       (next)
  261.     map (c-o)       (insertmode off)
  262.     map (c-p)       (prev)
  263.     map (c-q)       (quit)
  264.     map (c-r)       (wright)
  265.     map (c-s)       (split first down)
  266.     map (c-u)       (unblock)
  267.     map (c-up)      (pageup)
  268.     map (c-w)       (wordwrap toggle)
  269.     map (del)       (del)
  270.     map (down)      (down)
  271.     map (enter)     (return)
  272.     map (esc)       (esc)
  273.     map (f1)        (escimm (insfile ))
  274.     map (f10)       (saveold quit)
  275.     map (f2)        (escimm (newfile ))
  276.     map (f3)        (escimm (newwindow newfile ))
  277.     map (f6)        (saveold iconify)
  278.     map (f7)        (escimm (bsave ))
  279.     map (f8)        (saveold escimm (newfile ))
  280.     map (f9)        (saveold)
  281.     map (L-lmb)     (tomouse)
  282.     map (L-mmo)     (tomouse)
  283.     map (left)      (left)
  284.     map (R-rmb)     (iconify)
  285.     map (return)    (return insline up firstnb down)
  286.     map (right)     (right)
  287.     map (s- )       (( ))
  288.     map (s-del)     (deline)
  289.     map (s-down)    (bottom)
  290.     map (s-left)    (first)
  291.     map (s-right)   (last)
  292.     map (s-tab)     (backtab)
  293.     map (s-up)      (top)
  294.     map (sa-s)      (unblock block block bsource)
  295.     map (tab)       (tab)
  296.     map (up)        (up)
  297.  
  298.  
  299.  
  300.                     III
  301.                  COMMAND SEQUENCES
  302.  
  303. DME has a rich command set which allows you to embed commands within
  304. commands, or specify multiple commands in a row.  A command consists of a
  305. KEYWORD followed by a FIXED number of arguments (0, 1, 2...).  The argument
  306. delimeter in DME is a SPACE.  Therefore, to embed strings containing spaces
  307. as a single argument, you must surround the string with (string)
  308. (backsinglequote-string-singlequote).  TEXT to be written as if typed is
  309. also specified via a string in backquote-quotes.  For example:
  310.  
  311.     right right (hello) right right (hello) enter down
  312.     map f4 (right right) map f5 (left left)
  313.     map f4 ((hello))
  314.  
  315. Reiterating (because this is important!)... If a command expects ONE
  316. argument, then it really does expect a single argument, and any remaining
  317. arguments are thought to be the next command... so:
  318.  
  319.     map f4 right
  320.                     -right is only one word, so no need
  321.                      for ().
  322.     map f4 (right right)
  323.                     -we want to map f4 to two rights... we
  324.                      need the () or the second right will
  325.                      not be part of the map.
  326.  
  327.     map c-del (repeat cright del)
  328.                     -this is already implimented as REMEOL,
  329.                      but shown here for clarity.
  330.  
  331. Some arguments will eventually be fed through the command interpreter more
  332. than once.  The MAP command is a good example.    When you execute a MAP
  333. command, the first run through the command interpreter installs the map
  334. string minus a set of quotes.  So, if you want to specify text, you must
  335. enclose the text in two sets of ((text)) because the map string gets passed
  336. through the command interpreter again when you hit the mapped key.  Here
  337. are some more complex examples:
  338.  
  339.     map f4 (right right (hello) left left)      *RIGHT*
  340.     map f4 right right hello left left        *WRONG*
  341.  
  342.     map f4 (map f4 ((hello)))
  343.                     -the first time you hit F4, it's command
  344.                      is to re-map itself to the TEXT (hello).
  345.                      (gads!).
  346.  
  347.     map c-i (repeat tr (( )))
  348.                     -example of how to embed a space in a
  349.                      map and repeat (goes through command
  350.                      interpreter three times!).
  351.  
  352.  
  353. An easy way to fool around executing commands or making maps is either to
  354. use the ESC key (which enters command mode), or  a-S (alt-shift-s), which
  355. EXECUTES the current DME line that the cursor is on.... so you can use DME
  356. to edit and test your new keymappings.
  357.  
  358.  
  359.                 STRING VARIABLES
  360.  
  361.     String variables are replaced with their contents.    Three specification
  362.     forms are allowed:
  363.  
  364.     $varname        - varname can only consist of a-z,A-Z,0-9,-,_
  365.     $(varname)      - anything not containing a '(' or ')'
  366.     $`varname'      - anything not containing a '`' or '''
  367.  
  368.     Two special variables exist:
  369.  
  370.     filename    - the current filename
  371.     scanf        - the current scanf'd string (see SCANF below)
  372.     lineno        - the current cursor line number (1 .. N)
  373.     colno        - the current cursor column number (1 .. N)
  374.  
  375.     Other variables cause a search of three variable domains to find the
  376.     contents.  For example, if you give  $DMEFONT:
  377.  
  378.     (1) An Internal variable named DMEFONT is searched for.  Internal
  379.         variables are case sensitive.  (see SET, UNSET)
  380.  
  381.     (2) An Enviroment variable name DMEFONT is searched for.  Enviroment
  382.         variables are NOT case sensitive.  (see SETENV, UNSETENV).  The
  383.         1.3 ENV: is used.
  384.  
  385.     (3) A DME keymap or menu definition named DMEFONT is searched for.
  386.         This allows you to say something like $sa-tab to insert the
  387.         contents of the shift-alt-tab keymap.   (see MAP, UNMAP, and
  388.         MENU oriented commands).
  389.  
  390.     The reason for the other two forms of variable specifiction is to allow
  391.     one to access strangely named variables (with puncuation and other crap).
  392.  
  393.     SPECIAL NOTE:  What is wrong with this command?
  394.  
  395.     repeat 100 (first ($myvar))
  396.  
  397.     What is wrong is that $myvar is evaluated BEFORE the repeat is
  398.     executed.  myvar might contain characters that would confuse the
  399.     command specification when.  That is, if myvar contained a '(' you
  400.     could get something like:    repeat 100 (fist ((())  which is obviously
  401.     incorrect.    By using \ you can cause $myvar to be evaluated at
  402.     loop-execution time rather than before:
  403.  
  404.     repeat 100 (first (\$myvar))
  405.  
  406.     These kinds of problems can also occur when you do keymaps... you
  407.     probably do not want to evaluate the variable at keymap-entry time,
  408.     but rather would want the variable evaluated at keymap-execution time.
  409.  
  410.     On the otherhand, this is perfectly allowable:
  411.  
  412.     set x (tlate +1)
  413.     repeat 100 ($x)
  414.  
  415.     Which executes the command (tlate +1) 100 times... By NOT surrounding
  416.     the variable with parens (depends on the situation), the variable is
  417.     executed rather than inserted as text.
  418.  
  419.  
  420.                SPECIAL CHARACTERS
  421.  
  422.     ^ is used to introduce a control character.  For example, ^c would
  423.     embed a control-c.    You cannot embed c-@ (ascii code 0).
  424.  
  425.     backslash \ is used to override special meanings.  The next character
  426.     is overriden.
  427.  
  428.     map c-a ((^l))      -map control a to produce a control l
  429.     map c-a ((\\\^l))   -map control a to produce a "^l".  The first
  430.              \ overides the second, and the third overides
  431.              the ^.
  432.  
  433. COMMAND LIST:
  434.  
  435.     (text)          -enter text as if typed.
  436.     key         -execute a keymap as a macro (example:  c-a)
  437.     header-item     -execute a menu item as a macro (example: Project-Save)
  438.              (case independant)
  439.     ADDPATH path    -Add the specified symbolic directory to DME's special
  440.              search path (see REF and CTAGS).
  441.     ARPINSFILE        -INSFILE filerequestor, only if ARP.LIBRARY installed
  442.     ARPLOAD        -NEWFILE filerequestor, only if ARP.LIBRARY installed
  443.     ARPSAVE        -SAVEAS  filerequestor, only if ARP.LIBRARY installed
  444.     BACK        -same as BS
  445.     BACKTAB        -backward tab
  446.     BCOPY        -copy block before cursor line
  447.     BDELETE        -delete the block
  448.     BGPEN pen        -set background pen
  449.     BLOCK        -Set start or end of block
  450.     BMOVE        -move block before cursor line
  451.     BOTTOM        -Move to Bottom of File
  452.     BS            -backspace, (delete char to left of cursor)
  453.     BSAVE file        -save the block to a file
  454.     BSOURCE        -source current text block as if it were a script file
  455.     CHFILENAME name -change the name of the working file
  456.     CTAGS        -search for the tag under the cursor (see below)
  457.     DEL         -delete, (deletes char under cursor)
  458.     DELINE        -delete line
  459.     DOWN        -cursor down
  460.     DOWNADD        -cursor down.  If at bottom of text, add a line.
  461.     ESC         -toggle manual command entry mode
  462.     ESCIMM arg        -go into command entry mode prompting with a
  463.              predefined string.
  464.     EXECUTE comm    -Execute a CLI command
  465.     FGPEN pen        -Set foreground pen
  466.     FIND string     -SET the search pattern and do a NEXT
  467.     FINDR s1 s2     -Set find and replace patterns and do one find/rep.
  468.     FINDSTR string  -SET the search string pattern
  469.     FIRST        -move to column 1
  470.     FIRSTNB        -Move to first non-blank in line.
  471.     GOTO BLOCK        -Goto the beginning of the marked block.
  472.     GOTO START        -same as GOTO BLOCK.  undefined if no block
  473.     GOTO END        -goes to the END of the marked block.  undef. if no blk.
  474.     GOTO [+/-]N     -Goto an absolute or relative line number
  475.     HEIGHT N        -set height in PIXELS for any new windows
  476.     HGPEN pen        -set highlight pen
  477.     ICONIFY        -iconify the window
  478.     IF cnd act        -IF/WHILE/IFELSE.. SEE BELOW
  479.     IFELSE cnd ifact elseact
  480.     IGNORECASE what -set case ignore for seaches.  what = on, off, or toggle
  481.     INSERTMODE what -set INSERTMODE.  what = on, off, or toggle
  482.     INSFILE name    -insert a file into the current text.
  483.     INSLINE        -insert line
  484.     JOIN        -join next line to line at cursor
  485.     JUSTIFY how     -simple text justification.  Currently only 'full'
  486.              justification supported (justify full).
  487.     LAST        -move one beyond the last non-space in a line.
  488.     LEFT        -cursor left
  489.     LEFTEDGE N        -set leftedge on the screen in PIXELS for any new window
  490.     MAP key map     -map a key to a keymap
  491.     MARGIN N        -set WordWrap and paragraph formatting margin
  492.              (related to WORDWRAP and REFORMAT)
  493.     MENUADD hdr item cmd    -add menu item
  494.     MENUDEL hdr item        -delete menu item
  495.     MENUDELHDR hdr        -delete menu header
  496.     MENUCLEAR            -delete entire menu
  497.     MENUON            -enable menus  (multiple calls are stacked)
  498.     MENUOFF            -disable menus (multiple calls are stacked)
  499.     MODIFIED on/off/toggle
  500.             -set modified flag manually
  501.  
  502.     NEWFILE name    -replace current text with new file
  503.     NEWWINDOW        -open new window using default window parameters
  504.     NEXT        -find next occurance of search pattern
  505.     NEXTR        -find next occurance and replace
  506.     NULL        -no operation
  507.     OPENWINDOW geo  -open new window using specified geometry.    Geometry is
  508.              specified as:  +/-leftedge+/-topedge+/-width+/-height,
  509.              where negative numbers denote values relative to the
  510.              width or height of the screen.  For example, the
  511.              following opens a nearly full-screen window leaving
  512.              10 pixels above, below, to the left, and to the right:
  513.  
  514.             openwindow +10+10-10-10
  515.  
  516.              The following opens a window in the upper right hand
  517.              corner of width 320 and height 100.
  518.  
  519.             openwindow  -320+0+320+100
  520.             openwindow  -320+0-0+100    (same thing)
  521.             openwindow  -320-100-0-0    (lower rght hand corner)
  522.  
  523.     PAGEDOWN        -pagedown a partial page (see PAGESET)
  524.     PAGESET n        -n PERCENT (0 to 100). page step size relative to the
  525.              current number of rows in the window.
  526.     PAGEUP        -pageup a partial page (see PAGESET)
  527.     PING n        -set a text marker (0-9).
  528.     PONG n        -move to a previously set text marker (0-9)
  529.     PREV        -find previous occurance of search pattern
  530.     PREVR        -find previous occurance and replace
  531.     PUSHMARK        -push the currently marked block onto a stack and
  532.              unhighlight the block
  533.     POPMARK        -pop the block stack and highlight the popped block
  534.     PURGEMARK        -clear the mark stack
  535.     QUIT        -quit
  536.     RECALL        -recall most recently entered command.  Must be used
  537.              from a keymap (c-esc).
  538.     REF         -reference string under cursor (see below)
  539.     REFORMAT        -reformat paragraph using the margin.
  540.     REMEOL        -Remove text under and beyond the cursor.
  541.     REMPATH wild    -Remove one or more symbolic directorys from DME's
  542.              special path... a */? wildcard is acceptable.
  543.     REPEAT cnt comm -SEE BELOW
  544.     REPSTR string   -SET the replace string pattern
  545.     RESETTOGGLE N   -clear toggle array entry N(0..31)
  546.     RESIZE cols rows-Resize current window. E.G:  (resize 70 23)
  547.     RETURN        -same as (FIRST DOWNADD)
  548.     RIGHT        -cursor right
  549.     RX            -ARexx macro, no args   (RX macname)
  550.     RX1         -ARexx macro, one arg   (RX1 macname arg1)
  551.     RX2         -ARexx macro, two args  (RX2 macname arg1 arg2)
  552.     SAVEAS file     -save current text under a different name (title
  553.              line name does not change)
  554.     SAVECONFIG        -save current editor configuration to s:dme.config
  555.     SAVEMAP file    -save user keymappings
  556.     SAVEOLD        -save current text under current name
  557.     SAVESMAP file   -save all keymappings, including system keymaps
  558.     SAVETABS on/off -Optimize file saves by crunching spaces to tabs.
  559.              The default is OFF.
  560.     SCANF ctlstr    -scan the string at the current text position (C scanf)
  561.              example:    (scanf %s)          SEE BELOW
  562.     SCREENBOTTOM    -Move cursor to the bottom of the screen.
  563.     SCREENTOP        -Move cursor to the top of the screen
  564.     SCROLLUP        -Scroll up without moving cursor
  565.     SCROLLDOWN        -Scroll down without moving cursor
  566.  
  567.     SET var str     -create/modify an internal variable (access w/ $)
  568.     SETENV var str  -create/modify an enviroment variable (1.3 ENV:)
  569.     SETFONT font sz -Set the window's font.  ex:   (setfont topaz.font 11)
  570.  
  571.     SETPARCOL col   -Set the LEFT margin for word wrap mode paragraphing &
  572.              reformat.    MUST be less than MARGIN.
  573.  
  574.     SETTOGGLE N     -set toggle array entry N  (0..255)
  575.     SOURCE file     -source a script file. '#' in first column for comment
  576.     SPLIT        -Split line at cursor
  577.     SWAPMARK        -PUSHMARK, swap top two marks on stack, POPMARK
  578.     TAB         -forward tab
  579.     TABSTOP N        -Set tab stops every N.  does not effect text load
  580.     TITLE (title)   -set window title manually
  581.     TLATE [+/-]N    -translate character by +N or -N, or set character
  582.              to exactly N if no + or -. (e.g. TLATE +65 TLATE 3)
  583.     TMPHEIGHT N     -set window height for next window only, pixels
  584.     TMPWIDTH  N     -set window width for next window only,  pixels
  585.     TOGGLE N        -flip toggle array entry N (0..255)  (See IF)
  586.     TOMOUSE        -moves cursor to mouse position
  587.     TOP         -Move to Top of File
  588.     TOPEDGE N        -set topedge in the screen in PIXELS for any new window
  589.     TPEN pen        -set pen for title bar rendering
  590.     UNBLOCK        -clear the block markers for the current window
  591.     UNDELINE        -insert most recently deleted line (only last line saved)
  592.     UNDO        -undo current line (must be mapped to a key to work)
  593.     UNJUSTIFY        -removes extra spaces in a line
  594.     UNMAP key        -unmap a key
  595.     UP            -cursor up
  596.     UNSET var        -delete an internal variable
  597.     UNSETENV var    -delete an enviroment variable
  598.     WHILE cnd act   -(see below)
  599.     WIDTH N        -set width in PIXELS for any new window
  600.     WLEFT        -move to beginning of previous word.  If in the
  601.              middle of a word, move to beginning of current word.
  602.     WORDWRAP on/off/toggle
  603.             -Word Wrap mode (related to MARGIN)
  604.     WRIGHT        -move to beginning of next word
  605.  
  606.  
  607.     -------------------------------------------------------------
  608.     -------------    More Info on Complicated Commands    -----------------
  609.     -------------------------------------------------------------
  610.  
  611.     MENUOFF/ON        -This command will enable/disable menus.  Users
  612.              who have a whole bunch of MENUADD commands in
  613.              their .EDRC should note that disabling menus at
  614.              the beginning will speed up the MENUADD commands.
  615.              Then reenable menus at the end.  These calls are
  616.              stackable in that if you call MENUOFF, say, twice,
  617.              it will take two MENUON commands to restore
  618.              menus.  The reverse is not true.
  619.  
  620.     CTAGS   (c-[)   -(1.30B and beyond) Compatible with Aztec's CTAGS
  621.              program.  This command searches for the subroutine
  622.              name under the cursor in the associated tags file
  623.              ("tags" in the directory holding the file currently
  624.              being edited).  Also, the file "tags" in directories
  625.              specified by the special DME path (see ADDPATH and
  626.              REMPATH) will be searched.
  627.  
  628.              If the tag is found, it loads the file the subroutine
  629.              resides in if neccesary, then WindowToFront()'s the
  630.              window, ActivateWindow()s it, and GOTO's the line
  631.              where the subroutine starts.  The search within the
  632.              source file is anchored to the left column.  If the
  633.              file is already loaded, it is not reloaded.
  634.  
  635.              This enables a programmer to quickly trace subroutines
  636.              over an arbitrary number of files.
  637.  
  638.              The tags file contains one or more lines of the following
  639.              format:
  640.  
  641.              subroutine-name file-name /^search-pattern
  642.              (that's a slash and a carrot, then the pattern)
  643.  
  644.              -- EXAMPLE of 'TAGS' file:
  645.              setpen cmd1.c /^setpen(
  646.              do_up cmd1.c /^do_up(
  647.              --
  648.  
  649.             SPECIAL NOTE:  CTAGS will work even if you are not in
  650.             the directory containing the file.    You can thus place
  651.             a tags file in the directory containing the files it
  652.             references, and the filenames WITHIN the tags file need
  653.             not be a full path.
  654.  
  655.     REF     (c-])   -(1.28d and beyond).  This is a very powerful new
  656.              command that allows you to bring up a reference to
  657.              a keyword with a single keystroke.  This is useful for
  658.              programmers who have on-line documentation or fully
  659.              commented include files.  DME opens a window just big
  660.              enough to fit the reference.
  661.  
  662.              NOTE:  The new CTAGS command may be more suited to
  663.              your application.
  664.  
  665.              The reference keyword is the alpha-numeric string
  666.              currently under the cursor.  REF will search the
  667.              file DME.REFS in the directories listed by the
  668.              special DME path (see ADDPATH and REMPATH).  The
  669.              file must be built by the user and each line has the
  670.              following format:
  671.  
  672.              (keyword) (nolines/endstring) (file) (searchstr/##seekpos)
  673.  
  674.              Surrounding the keywords with `' or () is optional if
  675.              the keyword does not contain spaces.
  676.  
  677.             keyword     -keyword under cursor
  678.             nolines/ends-either a number (the number of lines
  679.                      in the reference) or a string denoting
  680.                      the end of the reference when found.
  681.             file        -the file containing the reference
  682.                      material
  683.             searchstr/##-search string in file that indicates
  684.                      the beginning of the reference, or
  685.                      two hashes (##) and the seek position
  686.                      in decimal (like ##2343).  The latter
  687.                      method is used mainly for reference-
  688.                      generator programs.
  689.  
  690.              Upon finding a successful keyword match the specified
  691.              file is openned and the seach string searched for.  If
  692.              a seek position was specified no search is made and a
  693.              seek is made to the beginning of the reference.  If
  694.              found, the indicated number of lines (if a number
  695.              is specified for <nolines/ends>) or until a match with
  696.              the endstring (if a string was specified) will be
  697.              placed in a temporary file and a new DME window
  698.              brought up. The temporary file is then deleted.
  699.  
  700.              When looking for matches, the compare is anchored at
  701.              the beginning of each line in the file.  Thus, any
  702.              spaces in front of the string in the file must be
  703.              duplicated.
  704.  
  705.              T: must be assigned to a temporary directory, usually
  706.              RAM:   See the included example DME.REFS file.  The
  707.              most common things referenced are the autodocs and
  708.              commented include files.
  709.  
  710.              Some modification of the included DME.REFS.* files may
  711.              be required due to differences in include file and
  712.              autodoc format.
  713.  
  714.     SCANF ctlstr    -This is equivalent to the C scanf() function with the
  715.              restriction that only one conversion is allowed, that
  716.              conversion being a string.  Thus:
  717.  
  718.              scanf %s        will place the string under the
  719.                     cursor in the variable $scanf
  720.  
  721.              scanf %4s        The first four chars of the string.
  722.  
  723.              scanf %[0123456789]
  724.                     will scan the string while it contains
  725.                     specified chars (e.g. scan a number)
  726.  
  727.              scanf %[~,]    will scan the string until it finds
  728.                     a ','.
  729.  
  730.             The variable $scanf may be used as an argument in any
  731.             command.  Example:    (insfile $scanf).
  732.  
  733.             NOTE:  If using $scanf in a macro, you probably want
  734.             to precede it with a \ to prevent it from being
  735.             evaluated at macro-creation time.
  736.  
  737.  
  738.     REPEAT N arg    -Repeat (arg) N times.  Apart from being a number, N
  739.              can also be one of:
  740.  
  741.             line    Current line # (lines begin at 1)
  742.             lbot    #lines to the bottom, including current line
  743.             cleft    column # (cols begin at 0)
  744.             cright    #chars to eol, including current char under cursor
  745.             tr    #char positions to next tab
  746.             tl    #char positions to next back tab
  747.  
  748.             Certain commands can abort a REPEAT loop.
  749.             Specifically, any FIND[R], NEXT[R], or PREV[R] in which
  750.             the search string is NOT found will abort a REPEAT.
  751.             Most operations which can go out of bounds, such as
  752.             UP, LEFT, RIGHT, DOWN, also abort a repeat.
  753.  
  754.             Specifying -1 as N causes REPEAT to go on forever
  755.             (well, actually, 0xFFFFFFFF times) or until an abort.
  756.  
  757.     IF [!]condition arg
  758.     WHILE [!]condition arg
  759.     IFELSE [!]condition arg else arg
  760.  
  761.         If the specified condition is true, execute the argument.  For
  762.         WHILE, the argument is executed until the condition is false
  763.         (be careful!).
  764.  
  765.         the optional '!' inverts the logic.
  766.  
  767.         Conditions:
  768.  
  769.  
  770.         #        if toggle entry # is SET.  there are 256 toggles (0..255)
  771.         t        if On line 1
  772.         b        if On last line
  773.         l        if At column 0
  774.         r        if At end of line (spaces below and beyond)
  775.         m        if Text has been modified
  776.         i        if in insert mode
  777.         x[<=>]# if column position (starts at 1) is (any OR combo of
  778.             <, =, or >) than some number.  Example:   x<=20
  779.         y[<=>]# if Line number (starts at 1) is (same as for x)
  780.         cl        character under cursor is lower case alpha
  781.         cu        character under cursor is upper case alpha
  782.         ca        character under cursor is alpha-numeric
  783.         cn        character under cursor is numeric
  784.         c[<=>]# character under cursor is ascii code # (# in decimal)
  785.             optional conditionals as in 'x' and 'y'.
  786.         cb        cursor within a block
  787.  
  788.     Example: simulating an insert mode toggle: ALT-i (not CTL-i)
  789.  
  790.     map a-i (ifelse 0 (toggle 0 insertmode OFF) (toggle 0 insertmode ON))
  791.  
  792.     Example: while lower case, map to upper case and move right.
  793.  
  794.     map c-U (while cl (tlate -32 right))
  795.  
  796.     Example: Search/Replace all of text.
  797.  
  798.     map c-R (escimm (findstr ) escimm (repstr ) repeat -1 nextr)
  799.  
  800.      if c<32 ((char under cursor is smaller than 32))
  801.      if c<>32 ((char under cursor is not equal to 32))
  802.      while !b down
  803.  
  804.  
  805.                     IV
  806.                  FILE PARTICULARS
  807.  
  808. No Matter what you set internal tabs to, tabs in disk files will be 8.
  809. This allows you to use your favorite tabs stops (mine are 4) and still
  810. have your disk files compatible with TYPE, a printer, etc...  DME by
  811. default doesn't bother to optimize when writing out files and simply uses
  812. spaces. If you (SAVETABS on) before saving (or in your S:.EDRC, etc...),
  813. DME will attempt to optimize the file by placing TABS in appropriate
  814. places.  DME will not place any TABS after the first single, back, or
  815. double quote is encountered in a line.    If this does not cover every
  816. situation in your particular application that you want to be *sure* no tabs
  817. will occur in sensitive sections, then you should not use (SAVETABS on).
  818.  
  819. It should be noted that since DME removes spaces at the end of the line,
  820. editing UUENCODED ascii files will not work for uuencoded lines which end
  821. with a space.  The nominal fix is to add an extra character after each
  822. uuencoded line (anything) in the proper column, which is ignored by the
  823. UUDECODE program.
  824.  
  825. The command to save the current document under the default name is SAVEOLD,
  826. *not* SAVE.  SAVE is not a valid command.  This is to prevent people who
  827. have not read the documentation from assuming 'save' takes an argument (and
  828. screwing up their work).  SAVEOLD does NOT take an argument, SAVEAS does.
  829.  
  830. SAVEOLD/SAVEAS do not automatically backup the destination file.  If you
  831. are working in an enviroment where you are worried about ensuring a viable
  832. copy can be recovered if your Amiga crashes in the middle of the save, you
  833. can write a macro to save the file into two places.  Usually, people backup
  834. their working disks so this is not neccesary.
  835.  
  836. Workbench Support:  If DME is run from the workbench, it will automatically
  837. construct an icon file when you save a document.  If run from a CLI, no
  838. icon file is generated.
  839.  
  840.                     V
  841.                   WORKBENCH SUPPORT
  842.  
  843. DME V1.26 and beyond support the workbench in the following way:  (1) you
  844. can click on the DME icon to bring up DME with the file "unnamed".  (2) you
  845. can select one or more standard ascii documents which have DME as the
  846. default tool.  If DME has no knowlege of a text icon, it uses its own.
  847. Command line arguments are passed to DME via the tooltypes entries for
  848. DME's application icon or via individual document icons.  The following
  849. format is used:  (This is a hack, no?)
  850.  
  851.     ****** WARNING, 1.40-41, most workbench options do not work.
  852.  
  853.     ARG=flag
  854.  
  855.     See the OVERVIEW section for allowed flags.  Only one argument per line
  856.     is allowed (sorry).  The tooltypes for the application icon are
  857.     processed first, then the tooltypes for each document icon are
  858.     processed before each file is loaded.
  859.  
  860.     ARG= -t10
  861.     ARG= -l10
  862.  
  863.  
  864.                     VII
  865.                 COMPILING
  866.  
  867. DME now compiles under either Manx C or Lattice C (V5.02 and beyond).
  868. dres.library is no longer required.
  869.  
  870.